package filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author d11yu
 */
@WebFilter(filterName = "Filter2", urlPatterns = "/target.jsp")
public class Filter2 implements Filter {
    @Override
    public void init(FilterConfig config) throws ServletException {
    }

    @Override
    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        System.out.println("Filter2前置代码");
        System.out.println("Filter2线程：" + Thread.currentThread().getName());
        chain.doFilter(request, response);
        System.out.println("Filter2线程：" + Thread.currentThread().getName());
        System.out.println("Filter2后置代码");
    }
}
